{include file=$header_start}
{strip}
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/dashboard.css">
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/find_job_list.css">
<link rel="stylesheet" href="{$siteroot}/includes/js/datepicker/themes/base/jquery.ui.all.css">
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery-1.5.1.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.core.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.widget.js"></script> 
<script type="text/javascript" language="javascript" src="{$siteroot}/includes/js/datepicker/jquery.ui.datepicker.js"></script> 
{/strip}
{literal}
<script type="text/javascript" language="javascript">
	$.noConflict();
	jQuery(document).ready(function($) {
		$( ".datepicker" ).datepicker({ minDate: "-50year", maxDate: "today",  changeMonth:"true", changeYear:"true", dateFormat:"yy-mm-dd", 
		  onClose: function() {
			this.focus();this.blur() 
		  }
		});
		$('.success_msg').fadeOut(6000);
	});
</script> 
<script type="text/javascript" language="javascript">
function searchOrder()
{
	var paymentfor = $('#paymentfor').val();
	var fromDate = $('#from_date').val();
	var toDate = $('#to_date').val();
	//if(searchField != '' && searchField != 'Search Order'){
		//alert(searchField);
		if(fromDate!='' && fromDate!='From Date' && toDate!='' && toDate!='To Date'){
			window.location = SITEROOT+'/payment/history/?paymentfor='+paymentfor+'&from_date='+fromDate+'&to_date='+toDate;
		} else {
			window.location = SITEROOT+'/payment/history/?paymentfor='+paymentfor;
		}
		
	//}
}
</script>
{/literal}
{include file=$header_end}


<section class="middle_portion">
	<section class="inner_head">Dashboard</section>
    <section class="inner_containstart">
    	<!-- dashboard Left Content Start -->
        	{include file=$cms_left_content}
        <!-- dashboard Left Content End -->
        <!-- dashboard Right Content Start -->
        	<section class="dash_right">
            <section class="title_box">
            	<h4>My Payment History</h4>
            	 <section class="clear"></section>
                 
                </section>                             


				{if $msg} {$msg} {/if}
                <section class="mainbox_findjobs">
				<section class="paymenthis_manag_box">
                
                 <section class="group_search_box">
                     <select class="select" name="paymentfor" id="paymentfor">
                        <option value="0">Select Payment For</option>
                        <option value="membershipplan" {if $smarty.get.paymentfor eq 'membershipplan'} selected="selected" {/if}>Membership Plan</option>
                        <option value="leadprice" {if $smarty.get.paymentfor eq 'leadprice'} selected="selected" {/if}>Lead Price</option>
                        
                     </select>   &nbsp;&nbsp;
                    <input type="text" name="from_date" id="from_date" class="input datepicker" value="{if $smarty.get.from_date}{$smarty.get.from_date}{else}From Date{/if}" onblur="if(this.value=='')this.value='From Date'" style="width:100px !important;" /> &nbsp;&nbsp;
                    <input type="text" name="to_date" id="to_date" class="input datepicker" value="{if $smarty.get.to_date}{$smarty.get.to_date}{else}To Date{/if}" onblur="if(this.value=='')this.value='To Date'" style="width:100px !important;" /> &nbsp;&nbsp;
                    <input type="button" class="btn" value="Go" onclick="searchOrder();">
                    &nbsp;&nbsp;
                    <input type="button" class="btn" value="Clear" onclick="javascript:window.location='{$siteroot}/payment/history';">
                    <section class="clear"></section>
                  </section>


                	<dl>
                    	<dt class="col1">Payment For</dt>
                        <dt class="col2">Amount</dt>
                        <dt class="col3"></dt>
                        <dt class="col6">Invoice</dt>
                        <dt class="col4">Method / Status</dt>
                        <dt class="col5">Date</dt>
                        <section class="clear"></section>
                    </dl>
                    {section name=i loop=$historyArray}
                    <dl>
                    	<dd class="col1">{$historyArray[i].paymentfor}</dd>
                        <dd class="col2">${$historyArray[i].amount} </dd>
                        <dd class="col3"></dd>
                        <dd class="col6">
                        <a href="{$siteroot}/maker/pdfmaker.php?uid={$historyArray[i].user_id}&invoiceid={$historyArray[i].id}">{$historyArray[i].invoiceid}</a>
              	<a href="{$siteroot}/maker/pdfmaker.php?uid={$historyArray[i].user_id}&invoiceid={$historyArray[i].id}" style="text-align:right; float:right;"><img src="{$siteroot}/images/pdf.png" /></a>
                        
                        </dd>
                        <dd class="col4"> {if $historyArray[i].pmethod neq '' } {$historyArray[i].pmethod} {else} Paypal {/if} / {if $historyArray[i].plan_id eq '1'}-{else} {$historyArray[i].status|ucfirst}{/if}</dd>
                        <dd class="col5">{$historyArray[i].status_date}</dd>
                        <section class="clear"></section>
                    </dl>
                    {sectionelse}
                    	<div class="error" style="padding:10px;text-align:center;">Oops, Sorry there are no Payment paid.</div>
                    {/section}
                  		{if $pagenation}
                            <section class="pagna">
                            {$pagenation}
                            </section>
                        {/if}
                             

                        
                        <section class="clear"></section>
                </section>   
                
                
                <section class="clear"></section>
                 	 <section class="bgimg_shadow"></section>
                 	<section class="clear"></section>
                </section>  
            </section>
        <!-- dashboard Right Content End -->
        	<section class="clear"></section>
    </section>
</section>
{include file=$footer}